<?php
	require_once 'simple_html_dom.php'; 
	
	function getindex(){
		//return file_get_contents('http://www.taobao.com');
		$html = file_get_html('http://www.taobao.com');

		// Find all images
		$arr = array();
		foreach($html->find('a[href^=http://list.taobao.com/browse/]') as $element)
			if(strstr($element->href, 'g,')==null && strstr($element->href, 'cat')==null ){
				
				$arr[$element->href]=$element->plaintext;
			}
		return $arr;
	}
	//echo 
	//print_r(getindex());
	function gettop(){
		//http://search8.taobao.com/browse/21-50023713/n-7-1----------------------0-false-----95---------------------------------42-list-coefp-0-all-50023713.htm#ListView
		//http://taoke.alimama.com/spreader/search_auction_from_engine.do?_input_charset=utf8&od=0&coms=&come=&hs=&he=&crs=&cre=&mid=0&q=16----&c=1624&na=16&oc=0&ocr=0&os=0&timestr=1244221421773
		$query = 'http://taoke.alimama.com/spreader/search_auction_from_engine.do?_input_charset=utf8&od=9&coms=&come=&hs=&he=&crs=&cre=&mid=0&q=30----&c=&na=30&oc=0&ocr=0&os=0&timestr=1244267026518';
		$json_string = file_get_contents( $query );
		//echo 'gb2312<p>';
		//print_r($json_string);
		//echo 'utf8<p>';
		//print_r(json_decode(iconv("GB18030", "UTF-8", $json_string)));
		//print_r($obj);
	}
	gettop();
?>